package com.danger.util;

/**
 * Created by 俊 on 2016/8/15.
 */
public class TimeUtil {

    public static String parseDuration(long duration) {
        float sum = ((float) duration / 1000) / 60;
        int minute = (int) sum;
        int second = (int) ((sum - (float) minute) * 60);
        if (minute / 10 == 0 && second / 10 == 0) {
            return "0" + minute + ":" + "0" + second;
        } else if (minute / 10 == 0 && second / 10 != 0) {
            return "0" + minute + ":" + second;
        } else if (minute / 10 != 0 && second / 10 == 0) {
            return minute + ":" + "0" + second;
        } else {
            return minute + ":" + second;
        }
    }
}
